package com.woniuxy.oldmanapi.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.oldmanapi.cvo.CardVo;
import com.woniuxy.oldmanapi.cvo.DeliveryDetailVo;
import com.woniuxy.oldmanapi.entity.Card;
import com.woniuxy.oldmanapi.entity.DeliveryMedicineBill;
import com.woniuxy.oldmanapi.mapper.CardMapper;
import com.woniuxy.oldmanapi.mapper.DeliveryDetailMapper;
import com.woniuxy.oldmanapi.mapper.DeliveryMedicineBillMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DeliveryDetailService {
    @Autowired
    DeliveryDetailMapper deliveryDetailMapper;

    @Autowired
    CardMapper cardMapper;

    public PageInfo<DeliveryDetailVo> findByCons(Date begin, Date end, int olderId, int size, int now) {
        PageHelper.startPage(now,size);
        List<DeliveryDetailVo> list=deliveryDetailMapper.selectByCons(begin,end,olderId);
        return  new PageInfo<>(list);
    }

    public List<DeliveryDetailVo> findDeliveryDetailByDid(int id) {
      return   deliveryDetailMapper.selectByDid(id);
    }

    public List<CardVo> findAllCardvoByCard(String cardName) {
     return  cardMapper.selectAllvoByCard(cardName);
    }
}
